package edu.hawaii.duedates.configuration.jaxb;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 * Test case for DueDates jaxb class.
 * @author Creighton Okada
 */
public class TestDueDates {
  /**
   * Test duedates functionality.
   */
  @Test
  public void testDueDates() {
    DueDates dd = new DueDates();
    String server = "mail.hawaii.edu";
    dd.setSmtpServer(server);
    dd.setUsers(null);
    
    Libraries libs = new Libraries();
    libs.getLibrary().clear();
    
    dd.setLibraries(libs);
    
    assertTrue("Should have empty libraries.", dd.getLibraries().getLibrary().isEmpty());
    assertEquals("Check smtp server.", server, "mail.hawaii.edu");
    assertNull("Users should be null.", dd.getUsers());
  }
}
